<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function Book(BookName,price,author) {
            this.BookName = BookName;
            this.price = price;
            this.author = author;
            this.read = function () {
                console.log('阅读了'+this.BookName);
                
            }
        }
        var book1 = new Book('白夜行','42.00','东野圭吾');
        book1.read();
        var book = new Book('谁的青春不迷茫','38.00','刘同');
        book.read();
        function Person(myName,bk) {
            this.myName = myName;
            this.bk = bk;
        }
        var p1 = new Person('老周',book);
        p1.bk.read();
        var p2 = new Person('老王',book1);
        p2.bk.read();
    </script>
</body>
</html>